<?php
defined('IN_ADMIN') or exit('No permission resources.');
include $this->admin_tpl('header','admin');
?>
<div class="pad-10">
<form name="searchform" action="" method="get" >
	<input type="hidden" value="<?php echo ROUTE_M;?>" name="m">
	<input type="hidden" value="<?php echo ROUTE_C;?>" name="c">
	<input type="hidden" value="<?php echo ROUTE_A;?>" name="a">
<input type="hidden" value="<?php echo $contest_id;?>" name="contest_id">
	<input type="hidden" value="" name="relation" id="relation">

<table width="100%" cellspacing="0" class="search-form">
    <tbody>
		<tr>
		<td align="">
		<div class="explain-col">
				姓名
				<input name="keywords" type="text" value="<?php echo stripslashes($_GET['keywords'])?>" style="width:330px;" class="input-text" />
				<input type="submit" name="search" class="button" value="<?php echo L('search');?>" />
	</div>
		</td>
		</tr>
    </tbody>
</table>
</form>
<div class="table-list">
    <table width="100%" cellspacing="0" >
        <thead>
            <tr>
				<th align="left"><?php echo L('contest_sign_name')?></th>
				<th align="left"><?php echo '性别'?></th>
				<th align="left"><?php echo '年龄'?></th>
				<th align="left"><?php echo "人物图"?></th>
				<th align="left"><?php echo "联系方式"?></th>
				<th align="left"><?php echo "上次编辑者"?></th>
            </tr>
        </thead>
    <tbody>
	<?php foreach($infos as $v) { ?>
	<tr onclick="select_list(this,<?php echo $v['id'];?>)" class="cu" title="<?php echo L('click_to_select');?>">
		<td align="left"><?php echo $v['real_name']?></td>
		<td align="left"><?php if($v['gender'] == '1'){echo '男';}elseif($v['gender'] == '2'){echo '女';}elseif($v['gender'] == '3'){echo '保密';}?></td>
		<td align="left"><?php if(empty($v['age'])){echo"<span style='color:red;'>（未设置）</span>";}else{echo $v['age'];}?></td>
		<td align="left"><?php if(!empty($v['image_square'])){?><img src="<?php echo $v['image_square'];?>" height="60"/><?php }else{echo"<span style='color:red;'>（未设置）</span>";}?></td>
		<td align="left"><?php if(empty($v['telephone'])){echo"<span style='color:red;'>（未设置）</span>";}else{echo $v['telephone'];}?></td>
		<td align="left"><?php if(empty($v['publisher'])){echo"<span style='color:red;'>（未设置）</span>";}else{echo $v['publisher'];}?></td>


	</tr>
	 <?php }?>
	    </tbody>
    </table>
   <div id="pages"><?php echo $pages;?></div>
</div>
</div>
<style type="text/css">
 .line_ff9966,.line_ff9966:hover td{
	background-color:#FF9966;
}
 .line_fbffe4,.line_fbffe4:hover td {
	background-color:#fbffe4;
}
</style>
<SCRIPT LANGUAGE="JavaScript">
<!--


	function select_list(obj,id) {
		var relation_ids =$('#relation').val();
		if($(obj).attr('class')=='line_ff9966' || $(obj).attr('class')==null) {
			$(obj).attr('class','line_fbffe4');

			if(relation_ids !='' ) {
				var r_arr = relation_ids.split('|');
				var newrelation_ids = '';
				$.each(r_arr, function(i, n){
					if(n!=id) {
						if(i==0) {
							newrelation_ids = n;
						} else {
						 newrelation_ids = newrelation_ids+'|'+n;
						}
					}
				});
				$('#relation').val(newrelation_ids);
			}
		} else {
			$(obj).attr('class','line_ff9966');

			if(relation_ids =='' ) {
				$('#relation').val(id);
			} else {
				relation_ids = relation_ids+'|'+id;
				$('#relation').val(relation_ids);
			}
		}
}
//-->
</SCRIPT>
</body>
</html>